

            <% 
            try                      {
            int index=0;
            int numberofpages=15;
            String pageindex = request.getParameter("index");
           // out.println(request.getParameter("index"));
            //out.println(pageindex);
            if(pageindex==null)
                            {
                             index=0;
                            }
             else
                            {
                            index=Integer.parseInt(pageindex);
                            }  %>
             <div class="pagination">
                 <%
                    if(index<6)
                               {
                       for(int i=1;i<=10&i<=numberofpages;i++)
                   {
                    String s="jokes"+i+".jsp?index="+i;
                    %>
                    <a href="<%=s%>" style="text-decoration: none"> <div class="paginationinner">  <font color="#848484"><%=i%></font></div></a>
                    <%
                   }
                }
                         else
                               {
                int start=index-5;
                int end = index+5;
                   for(int i=0;i<10&start<end&start<=numberofpages;i++)
                   {
                   index=index+1;
                    String s="jokes"+start+".jsp?index="+start;
                    %>
                    <a href="<%=s%>" style="text-decoration: none"> <div class="paginationinner">  <font color="#848484"><%=start%></font></div></a>
                    <%
                    start++;
                   }
                }
%>
            </div>
            <%
            }
                           
                           catch(Exception e)
                                 {
                                 }
                %>
        
